<template>
  <div class="app-container pagebox">
    <a-row :gutter="16">
      <!--  车间报警状态   -->
      <a-col :xl="12" :xxl="12">
        <WorkShopAlarm ref="WorkShopAlarm" />
      </a-col>
      <!--  设备基本数据   -->
      <a-col :xl="12" :xxl="12">
        <BasicData />
      </a-col>
    </a-row>
    <br />
    <!--  信息区域  -->
    <a-card>
      <!--  机床   -->
      <MachineTool v-if="!isFSBS" @setAlarm="setAlarm" />
      <a-divider v-if="!isFSBS"/>
      <!--   数控系统   -->
      <ControlSystem v-if="!isFSBS"/>
      <a-divider v-if="!isFSBS"/>
      <!--  伺服电机   -->
      <ServoMotor v-if="!isFSBS"/>
      <FSBS v-if="isFSBS && isOutFeed"></FSBS>
    </a-card>
  </div>
</template>

<script>
import WorkShopAlarm from '@/pages/deviceDetail/components/WorkShopAlarm';
import BasicData from '@/pages/deviceDetail/components/BasicData';
import MachineTool from '@/pages/deviceDetail/components/MachineTool';
import ControlSystem from '@/pages/deviceDetail/components/ControlSystem';
import ServoMotor from '@/pages/deviceDetail/components/ServoMotor';
import FSBS from '@/pages/deviceDetail/components/FSBS';
export default {
  name: 'index',
  components: { ServoMotor, ControlSystem, MachineTool, BasicData, WorkShopAlarm, FSBS },
  mounted() {},
  computed: {
    isFSBS() {
      let macsn = this.$route.query.macsn
      let strList = macsn.split('_');
      return strList.indexOf('FSBS') > -1
    },
    isOutFeed() {
      let macsn = this.$route.query.macsn
      let strList = macsn.split('_');
      return strList.indexOf('OutFeed') > -1
    },
  },
  methods: {
    setAlarm() {
      this.$refs.WorkShopAlarm.getSelectArchives();
    },
  },
};
</script>

<style scoped lang="less"></style>
